package org.example;

import org.example.service.OrderService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
public class AnnoMain {
    public static void main(String[] args) {
        ApplicationContext context =new AnnotationConfigApplicationContext(AnnoMain.class);
        OrderService orderService =(OrderService) context.getBean("orderService");
        orderService.buy();
    }
}
